package com.yehun.entity;

import com.yehun.enums.StatusEnum;
import com.yehun.validator.NotEnum;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
public class Test {

    private int id;

    @Length(min = 2, max = 10, message = "min:{min}, max:{max}")
    @NotBlank(message = "name不能为null")
    private String name;

    @NotBlank(message = "value不能为null")
    private String value;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date date;

    @NotEnum(message = "状态不能为null", exclude = -999)
    private StatusEnum status;
}
